#include "../typepool.h"
#include <stdio.h>

int main()
{
    struct type_pool_s* p = type_pool_new(2, sizeof(int));
    int* p1 = (int*)type_pool_claim(p);
    *p1 = 45;
    printf("p1 is %d\n", *p1);
    int* p2 = (int*)type_pool_claim(p);
    printf("p2 is %d\n", *p2);

    type_pool_increase(p, 2);
    int* p3 = (int*)type_pool_claim(p);
    int* p4 = (int*)type_pool_claim(p);

    printf("p3 is %d\n", *p3);
    printf("p4 is %d\n", *p4);
    type_pool_reclaim(p, (void*)p1);
    p4 = (int*)type_pool_claim(p);
    printf("p4 is %d\n", *p4);
    return 0;
}
